<!--{template /module/admin/view/head}-->
<div id="left_layout">
	<div id="main_content" class="container-fluid">
		<!--{template /module/admin/view/head_nav}-->
		<div class="row-fluid">
			<form method="post" action="{$ADMIN_SCRIPT}/note/{$dispatches[method]}&id={$_var[gp_id]}&page={$_var[page]}&psize={$_var[psize]}{$search[querystring]}" onsubmit="javascript:return check_form(this);">
			<input type="hidden" name="formsubmit" value="yes" />
				<div class="well widget">
					<div class="widget-header">
						<p class="text">* {lang admin.validate.require}</p>
					</div>
					<div class="widget-content">
						<fieldset>
						
							<label>{lang note.index_edit.view.no.label}</label>
							<input type="text" class="input-mini" name="txtDisplayOrder" placeholder="{lang note.index_edit.view.no.placeholder}..." maxlength="3" value="{$note[DISPLAYORDER]}" /> 
							<span class="help-inline">{lang note.index_edit.view.no.tips}</span>
							
							<label>{lang note.index_edit.view.name.label} *</label>
							<input type="text" class="input-medium" name="txtTitle" placeholder="{lang note.index_edit.view.name.placeholder} ..." maxlength="50" value="{$note[TITLE]}" /> 
							<span class="help-inline">{lang note.index_edit.view.name.tips} </span>
							
							<label>{lang note.index_edit.view.begindate.label}</label>
							<input type="text" name="txtBeginDate" maxlength="12" class="input-medium input-date" value="{$note[BEGINDATE]}"/>
							
							<label>{lang note.index_edit.view.enddate.label}</label>
							<input type="text" name="txtEndDate" maxlength="12" class="input-medium input-date" value="{$note[ENDDATE]}"/>
							
							<hr/>
							
							<label>{lang note.index_edit.view.remark.label}</label>
							<textarea class="span6" rows="4" cols="45" name="txtRemark">{$note[REMARK]}</textarea>
							<span class="help-inline">{lang note.index_edit.view.remark.tips}</span>
							
							<hr/>
							<label>{lang note.index_edit.view.needs.label}</label>
							<label class="checkbox inline">
								<input type="checkbox" name="cbxNeeds[department]" class="fancy" value="1"  {if $note['NEEDS']['department']}checked="checked"{/if} /> {lang note.index_edit.view.needs.department}
							</label>
							<label class="checkbox inline">
			                	<input type="checkbox" name="cbxNeeds[place]" class="fancy" value="1" {if $note['NEEDS']['place']}checked="checked"{/if} /> {lang note.index_edit.view.needs.place}
							</label>
							<label class="checkbox inline">
			                	<input type="checkbox" name="cbxNeeds[email]" class="fancy" value="1" {if $note['NEEDS']['email']}checked="checked"{/if} /> {lang note.index_edit.view.needs.email}
							</label>
							<label class="checkbox inline">
			                	<input type="checkbox" name="cbxNeeds[connect]" class="fancy" value="1" {if $note['NEEDS']['connect']}checked="checked"{/if} /> {lang note.index_edit.view.needs.connect}
							</label>
							
							<hr/>
							<label>{lang note.index_edit.view.guest.label}</label>
							<label class="checkbox inline">
								<input type="radio" name="rdoGuest" class="fancy" value="1"  {if $note['GUEST'] == 1}checked="checked"{/if} /> {lang note.index_edit.view.guest.enabled} 
							</label>
							<label class="checkbox inline">
                				<input type="radio" name="rdoGuest" class="fancy" value="0"  {if $note['GUEST'] == 0}checked="checked"{/if} /> {lang note.index_edit.view.guest.disabled}
							</label>
							<span class="help-inline">{lang note.index_edit.view.guest.tips}</span>
							
							<hr/>
							<label>{lang note.index_edit.view.reply.label}</label>
							<label class="checkbox inline">
								<input type="radio" name="rdoReply" class="fancy" value="1"  {if $note['REPLY'] == 1}checked="checked"{/if} /> {lang note.index_edit.view.reply.enabled} 
							</label>
							<label class="checkbox inline">
                				<input type="radio" name="rdoReply" class="fancy" value="0"  {if $note['REPLY'] == 0}checked="checked"{/if} /> {lang note.index_edit.view.reply.disabled}
							</label>
							<span class="help-inline">{lang note.index_edit.view.reply.tips}</span>
						</fieldset>
						
						<hr/>
						
						<fieldset>
							<!--{if $dispatches['method'] == '_pub'}-->
							<button type="submit" class="btn btn-small btn-primary" {$dispatches[operations][add]}>{lang admin.operation.submit}</button>
							<!--{else}-->
							<button type="submit" class="btn btn-small btn-primary" {$dispatches[operations][edit]}>{lang admin.operation.submit}</button>
							<!--{/if}-->
							<button type="reset" class="btn btn-small">{lang admin.operation.reset}</button>
							<button type="button" class="btn btn-small" onclick="javascript:location.href='{$ADMIN_SCRIPT}/note&page={$_var[page]}&psize={$_var[psize]}{$search[querystring]}';">{lang admin.operation.go.back}</button>
						</fieldset>
					</div>
				</div>	
			</form>
		</div>
	</div>
</div>

<script>
function check_form(frm){
	if(frm.txtTitle.value.trim().length == 0){
		$(frm.txtTitle).next('.help-inline').css('color', 'red');
		frm.txtTitle.focus();
		return false;
	}

	return true;
}
    
$(function(){
	$('.fancy').uniform();
	
	$('fieldset input,textarea,select').blur(function(){
		$(this).next('.help-inline').css('color', '#333');
	});
	
	$(".input-date").datepicker({format:'yyyy-mm-dd'});
});
</script>
<!--{template /module/admin/view/foot}-->